//
//  UIViewController+ExchageDeallocFunction.m
//  etionUI
//
//  Created by wjxfhxy on 15/8/22.
//  Copyright (c) 2015年 GuangZhouXuanWu. All rights reserved.
//

#import "UIViewController+ExchageDeallocFunction.h"

#ifdef DEBUG

@implementation UIViewController (ExchageDeallocFunction)

+ (void)load
{
    Method oriMethod = class_getInstanceMethod([self class], @selector(dealloc));
    Method newMethod = class_getInstanceMethod([self class], @selector(deallocDebug));
    method_exchangeImplementations(oriMethod,newMethod);
}

- (void)deallocDebug
{
    NSString *className = NSStringFromClass([self class]);
    NSString *s = [NSString stringWithFormat:@"%@ dealloc",className];
    NSLog(@"%@",s);
    [self deallocDebug];
}

@end

#endif